import { defineConfig, DefaultTheme } from "vitepress";
import {
  componentPreview,
  containerPreview,
} from "@vitepress-demo-preview/plugin";

const nav: DefaultTheme.NavItem[] = [
  {
    text: "指南",
    link: "/guide/",
  },
  {
    text: "组件",
    items: [
      {
        text: "组件1",
        link: "/components/component.md",
      },
    ],
  },
];

const sidebar: DefaultTheme.Sidebar = {
  "/guide": [
    {
      text: "指南",
      items: [
        {
          text: "组件库介绍",
          link: "/guide/",
        },
        {
          text: "快速开始",
          link: "/guide/",
        },
      ],
    },
  ],
  "/components": [
    {
      text: "通用组件",
      items: [{ text: "基础组件1", link: "/components/component.md" }],
    },
  ],
};

export default defineConfig({
  title: "浏览器标题",
  description: "浏览器标题描述",
  lang: "cn-ZH",
  base: "/",
  lastUpdated: true,
  markdown: {
    theme: {
      light: "vitesse-light",
      dark: "vitesse-dark",
    },
    lineNumbers: true,
    config(md) {
      md.use(componentPreview);
      md.use(containerPreview);
    },
  },
  themeConfig: {
    nav,
    sidebar,
  },
});
